package com.jhx.demos.web.mapper;

import com.jhx.demos.web.pojo.Admin;
import com.jhx.demos.web.pojo.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminMapper {

    /*
查询全部信息
@return
 */
    @Select("select * from admin")
    List<Admin> list();

    /**
     * 新增管理员
     *
     * @param
     * @return
     */
    @Insert("insert into admin(admName, password, e_mail, admType) values(#{admName},#{password},#{eMail},#{admType})")
    void insert(Admin adm);


    void delete(Integer id);

    //查询数据进行回显
    @Select("select * from admin where id=#{id}")
    Message name(Integer id);

    void update(Admin adm);

    @Select("select * from admin where admName = #{admName} and password = #{password}")
    Admin login1(Admin admin);


}
